

package com.hazelcast.sql.impl;

import com.hazelcast.internal.serialization.ReflectionClassNameFilter;
import com.hazelcast.spi.annotation.PrivateApi;
import com.hazelcast.sql.SqlResult;
import com.hazelcast.sql.SqlService;
import com.hazelcast.sql.SqlStatement;
import com.hazelcast.sql.impl.security.SqlSecurityContext;
import com.hazelcast.sql.impl.state.QueryClientStateRegistry;

import javax.annotation.Nonnull;

/**
 * Non-public methods that the `hazelcast` module needs to call in the
 * implementation in the `hazelcast-sql` module, extending the public {@link
 * SqlService}.
 */
public interface InternalSqlService extends SqlService {

    String SERVICE_NAME = "hz:impl:sqlService";

    void start();

    void reset();

    void shutdown();

    void closeOnError(QueryId queryId);

    SqlResult execute(@Nonnull SqlStatement statement, SqlSecurityContext securityContext);

    SqlResult execute(@Nonnull SqlStatement statement, SqlSecurityContext securityContext, QueryId queryId);

    SqlResult execute(@Nonnull SqlStatement statement, SqlSecurityContext securityContext, QueryId queryId, boolean skipStats);

    QueryClientStateRegistry getClientStateRegistry();

    long getSqlQueriesSubmittedCount();

    long getSqlStreamingQueriesExecutedCount();

    String mappingDdl(String name);

    ReflectionClassNameFilter getReflectionClassNameFilter();

    @PrivateApi
    Object getOptimizer();
}
